<script type="application/javascript" src={{ url_for('templates',path='jquery-3.5.0.min.js') }} ></script>
<body>
    <h1>算法明细</h1>
	<h1>{{ algorithm.algorithm_code }}
	<h1> 
	<table border=1 width=100%>
	<tr>
	<td>模型编码</td>
	<td>{{algorithm.algorithm_code}}</td>
	<td>模型名称</td>
	<td>{{algorithm.algorithm_name}}</td>
	</tr>
	<tr>
	<td>算法描述</td>
	<td colspan=3>{{algorithm.algorithm_desc}}</td>
	</tr>
	<tr>
	<td>算法文档</td>
	<td><a href="/AIUama/download/{{algorithm.algorithm_code}}/{{algorithm.algorithm_doc}}" >{{algorithm.algorithm_doc}}</a></td>
	<td>训练样本模板文件</td>
	<td><a href="/AIUama/download/{{algorithm.algorithm_code}}/{{algorithm.training_template}}" >{{algorithm.training_template}}</a></td>
	</table>
	
	<h1>模型明细</h1>
	<h1>{{model.model_code}}
	<h1> 
	<table border=1 width=100%>
	<tr>
	<td>模型编码</td>
	<td>{{model.model_code}}</td>
	<td>模型名称</td>
	<td>{{model.model_name}}</td>
	</tr>
	<tr>
	<td>模型描述</td>
	<td colspan=3>{{model.model_desc}}</td>
	</tr>
	<tr>
	<td>样本文件</td>
	<td><a href="/AIUama/download/{{algorithm.algorithm_code}}/{{model.model_code}}/{{model.training_file}}" >{{model.training_file}}</a></td>
    <td>增量样本文件</td>
	<td>{{model.incremant_file}}</td>
	</table>
	
	<h1>参数设置：</h1>
	<h1> 
	<table  width=100%>
	<tr>
	<td><textarea rows="5" style="width:99%" id="params" name="params"/></textarea></td>
	</tr>
	<tr>
	<td><input type="submit" onClick="call('/AIUama/model/call/{{model.algorithm_code}}/{{model.model_code}}')"></td>
	</tr>
	</table>
	
	<h1>调用结果：</h1>
	<h1> 
	<table  width=100%>
	<tr>
	<td><textarea rows="5" style="width:99%" id="result" name="result"/></textarea></td>
	</table>
	
</body>
<script>
    function call(url) {
        var params = $('#params').val()
        data = {'params':params}
        $.post(url,data,function(data){
            $('#result').text(JSON.stringify(data))
        })
    }
    
</script>